package cn.com.yusys.yusp.mobile.web.rest;

import cn.com.yusys.yusp.commons.dto.Obj;
import cn.com.yusys.yusp.commons.mapper.QueryModel;
import cn.com.yusys.yusp.commons.web.rest.dto.ResultDto;
import cn.com.yusys.yusp.mobile.service.IntegralService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping({"/api/integral","/mobile/integral"})
public class IntegralResource {
    @Resource
    IntegralService integralService;


    @PostMapping("/addIntegral")
    public ResultDto<Integer> addIntegral(@RequestBody Map map){
        return new ResultDto<>(integralService.addIntegral(map));
    }

    @GetMapping("/getUserIntegralScore")
    public ResultDto<Map<String, Object>> getUserIntegralScore(QueryModel queryModel){
        return new ResultDto<Map<String, Object>>(integralService.getUserIntegralScore(queryModel));
    }
}
